#ifndef __TRANSLATIONS_SQLFIELD_H__
#define __TRANSLATIONS_SQLFIELD_H__

#include <iostream>
#include <vector>

#include "character.h"

enum sql_field_class {
  DATA,
  PERCENT,
  UNDERLINE,
  ESCAPE
};

class sql_field_character {
public:
  sql_field_character(
            const std::string& data,
            sql_field_class sql_field_class):
    _data(data),
    _class(sql_field_class)
  {

  }

  sql_field_class getClass() {
    return _class;
  }

  void setClass(sql_field_class sql_field_class) {
    _class = sql_field_class;
  }

  std::string& getData() {
    return _data;
  }

  void setData(const std::string& data) {
    _data = data;
  }

private:
  std::string _data;
  sql_field_class _class;
};

int sql_field_trans_in_like(
  const std::string& input,
  std::vector<sql_field_character>& output,
  std::string escape,
  CHARSET_E ch);

int sql_field_trans_in_insert(
  const std::string& input,
  std::vector<sql_field_character>& output,
  CHARSET_E ch);

std::string sql_field_build_in_like(
  std::vector<sql_field_character>& input,
  std::string escape);

std::string sql_field_build_in_insert(
  std::vector<sql_field_character>& input);

#endif // end of __TRANSLATIONS_SQLFIELD_H__

